package com.tengju.motivation.domain.model.performance;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum PerformanceObjectiveTypeEnum {

    CLUB(1, "俱乐部日常目标"),
    GEN_SEC(2, "广义SEC目标"),
    SERVICE_PROVIDER(3,"服务商一星团队目标"),
    CHUN_MIAO_PLAN_USER(4,"春苗计划用户目标")
    ;
    private Integer code;
    private String desc;

    PerformanceObjectiveTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }


    public static PerformanceObjectiveTypeEnum form(Integer code) {
        return Arrays.stream(PerformanceObjectiveTypeEnum.values())
                .filter(k -> k.getCode().equals(code))
                .findFirst().orElse(null);
    }
}
